package com.myjpa.config;

import com.myjpa.common.json.JacksonMapper;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: yaoll
 * @date: 2020-09-04
 * @verison: 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {


	@Bean
	public HttpMessageConverters customConverters() {
		MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
		converter.setObjectMapper(JacksonMapper.nonEmptyMapper);
		return new HttpMessageConverters(converter);
	}

}
